﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ERP.Manager.DataProvider;
using ERP.Manager.DataEntity;
namespace ERP.Manager.BusinessServices
{
    public class ECS_brandinfoServices
    {
        private readonly IECS_brandinfoRepository ecs_brandinforepository;
        public ECS_brandinfoServices() { }
        public ECS_brandinfoServices(IECS_brandinfoRepository ecs_brandinforepository)
        {
            this.ecs_brandinforepository = ecs_brandinforepository;
        }
        #region 分页查询所有商品品牌信息的方法
        public List<ECS_brandinfo> all_getcs_brandinfo_page(int pagecount)
        {
            return ecs_brandinforepository.all_getcs_brandinfo_page(pagecount);
        }
        #endregion

        #region 查询所有商品品牌信息的方法
        public List<ECS_brandinfo> all_ecs_brandinfo()
        {
            return ecs_brandinforepository.all_ecs_brandinfo();
        }
        #endregion

        #region 添加商品品牌信息的方法
        public int add_ecs_brandinfo(ECS_brandinfo brand)
        {
            return ecs_brandinforepository.add_ecs_brandinfo(brand);
        }
        #endregion

        #region 根据编号查询商品品牌信息的方法
        public ECS_brandinfo detail_ecs_brandinfo(int brand_id)
        {
            return ecs_brandinforepository.all_ecs_brandinfo().Find(brand => brand.brand_id == brand_id);
        }
        #endregion

        #region 修改商品品牌信息的方法
        public int update_ecs_brandinfo(ECS_brandinfo brand)
        {
            return ecs_brandinforepository.update_ecs_brandinfo(brand);
        }
        #endregion

        #region 删除商品品牌信息的方法
        public int delete_ecs_brandinfo(int brand_id)
        {
            return ecs_brandinforepository.delete_ecs_brandinfo(brand_id);
        }
        #endregion

        #region 修改商品的显示状态的方法
        public int update_ecs_brand_is_show(int brand_id, int is_show)
        {
            return ecs_brandinforepository.update_ecs_brand_is_show(brand_id, is_show);
        }
        #endregion

        #region 查询商品品牌的条数的方法
        public int all_getecs_brandinfo_count()
        {
            return ecs_brandinforepository.all_ecs_brandinfo().Count;
        }
        #endregion
    }
}
